package org.sfs.main;

public class StringFeatureSample {
	
	public static boolean isSafetyPassword(String password){
		
		StringFeatures sf = new StringFeatures(password);
		boolean requireResult = sf.require().hasNumber().isTrue();
		boolean optionalResult1 = sf.optional().hasLowerCase().hasUpperCase().isTrue();
		boolean optionalResult2 = sf.optional().hasOrdinaryPunctuation().isTrue();
		return (requireResult && optionalResult1 && optionalResult2);
		
	}
	
	public static boolean isSafetyInputValue(String value){
		StringFeatures sf = new StringFeatures(value);
		boolean optionalResult1 = sf.optional().hasLetter().hasNumber().isTrue();
		boolean optionalResult2 = sf.optional().hasAnyPunctuation().isTrue();
		return (optionalResult1 && !optionalResult2);
	}

}
